Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[11.x] Add Macroable to PendingCommand #51572

Merged
merged 1 commit into from
May 27, 2024

Conversation

PerryvanderMeer
Copy link
Contributor

@PerryvanderMeer PerryvanderMeer commented May 26, 2024

I would like to add some custom assertions for our console tests, but there is currently no way to extend the PendingCommand (used for testing). By adding the Macroable trait, it will be possible to write custom assertions like:

PendingCommand::macro('expectsOutputToBeFoo', function () {
    $this->expectsOutput('foo');

    return $this;
});

$this->artisan('foo')->expectsOutputToBeFoo();

@taylorotwell taylorotwell merged commit 88a7b47 into laravel:11.x May 27, 2024
30 checks passed
@PerryvanderMeer PerryvanderMeer deleted the patch-1 branch May 27, 2024 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants